package com.light.model;

import com.light.constant.Constant;
import com.light.util.SwingUtil;

/**
 * @Author MoonlightL
 * @ClassName: Land
 * @ProjectName flappy_bird
 * @Description: 地面
 * @DateTime 2023/3/13, 0013 11:24
 */
public class Land extends GameElement {

    public Land(int x, int y) {
        super(x, y, SwingUtil.getImageIcon("img/land.png").getImage());
    }

    @Override
    public void reset() {

    }

    public void keepMove(int x, int y) {
        if (x <= Constant.WIN_WIDTH - getWidth()) {
            this.setX(0);
            return;
        }
        this.setX(x);
        this.setY(y);
    }
}
